﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.ServiceProcess;

namespace BuildManager.DeploymentAgent
{
	[RunInstaller(true)]
	public class Installer : System.Configuration.Install.Installer
	{
		public Installer()
		{
			var processInstaller = new ServiceProcessInstaller();
			var serviceInstaller = new ServiceInstaller();

			//set the privileges
			processInstaller.Account = ServiceAccount.LocalSystem;

			serviceInstaller.DisplayName = Program.ServiceName;
			serviceInstaller.StartType = ServiceStartMode.Automatic;
			serviceInstaller.ServiceName = Program.ServiceName;

			this.Installers.Add(processInstaller);
			this.Installers.Add(serviceInstaller);
		}
	}
}
